SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

<#list entityList as entity>
-- ----------------------------
-- ${entity.remark}
-- ----------------------------
CREATE TABLE `${entity.name}` (
  <#list entity.fieldList as field>
    <#if field.isPK==1>
  `${field.name}` int(10) NOT NULL AUTO_INCREMENT,
    <#else>
  `${field.name}` ${field.type.tableType} <#if field.type.javaType=="String">CHARACTER SET utf8 COLLATE utf8_general_ci</#if> DEFAULT NULL,
    </#if>
  </#list>
  <#list entity.fieldList as field>
    <#if field.isPK==1>
  PRIMARY KEY (`${field.name}`)
    </#if>
  </#list>
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

</#list>